back to index.

Assembled - Interview Experience

Just out of my technical screening interview at Assembled. Moderately happy with how it went, my first time going through the technical interview process but I eventually got solutions to both of the problems posed. This one followed on from my phone screener back on Monday with Ryan. Following that I received an email with their interview process, which is a technical screen over Zoom or similar, and then a 4 hour onsite if you make it through.

Lynn from Assembled was the technical interviewer, and everything was done through Zoom with me screen-sharing as I worked on the problems. I'm glad they let me use C# for the interview, it's the language I'm strongest in and I would have fought a bit more with stupid things if I were working through this in javascript.

The interview was only a short 45 minute screener, so after quick introductions, we kicked right into the problem set.

First Problem

The first problem was fairly simple, and it's still the one I got tripped up on.

Given an array of positive integers, find the lowest missing positive value. I messed up here by not taking down both sets of sample data given to me. Each caught a different edge case, so that was already off to a bad start.

I asked could I use a List to manage the data, which was fine. All of my exploratory work was done using lists, and I had the intention of implementing a function to convert the input array to a list that I would write once my test data worked, but when it came to it, I was told not to bother.

My solution to the problem was not the most elegant. I first sorted the list, then iterated through. If the next value wasn't the one expected from the previous, that is, if it wasn't 1 more than the previous, then that was the answer. If you're at the end of the list and still haven't missed a number, then the last number plus 1 is what to return. I was originally returning -1 as a final catch for this but then got the last number plus 1 solution. There were a few edge cases I had to work through with some help from the interviewer.

Check for zero length in the input data. It took a "this will throw an exception" from the interviewer and a tip to look at the list length before I caught it. Mistake one.

If the list doesn't start at 1, then 1 is the obvious answer. Again, I missed this. The sample data I was using had a 1, so it was only when I was given the first data again that it came up.

Second Problem

The second problem followed on from the first problem, with the main logic being an adaptation of the first solution.

Given a sample interaction with an API. Implement the API. The API sample is given below, translated from the Go I think it was originally, to what I ended up using. Lynn ran me through the sample calls, and then I asked a few questions and started working.

Tracker tracker = new Tracker(); tracker.allocate("storage"); //return "storage-1" tracker.allocate("storage"); //return "storage-2" tracker.deallocate("storage-1"); //return null tracker.allocate("storage"); //return "storage-1" tracker.allocate("metrics"); //return "metrics-1"

Right off the bat it's clear that the allocate function will use similar logic to the lowestMissingNumber function from the first problem.

My approach was to make two classes, Server and Tracker. Servers would contain a string for the type name, i.e. storage or metrics. They would also have an int giving their id number, i.e. 1 for storage-1, 2 for storage-2. These were private variables with public functions for accessing them, and a helper function that gave the server name, the string combining the two values with a hyphen delimiting.

The Tracker class would hold a list of Servers. On allocate, it would run the lowestMissingNumber function on a sub list that was just the servers of the type passed as an argument, and get the lowest unallocated id. Then create a new server with that id and add it to the server list. It would then return the new server's name.

The deallocate function ran through the server list and would remove the server with the name given as an argument from the list, then break the loop. This was a void function as there was no required value to be returned.

On top of these two required functions, I implemented a listServers function that printed to the console exactly what you'd expect, just to make sure the class was working as intended.

I worked through the functions one at a time as I was working, implementing allocate, ensuring it was returning the expected values, and then working on deallocate. I probably should have outlined what I was doing in each of them before starting to code, but things turned out fine in the end.

I should have added a check to the allocate function to ensure the desired server type argument string passed is not empty. There was no requirement that a server had to have a serverType specified, but it seems to be in the spirit of the problem.

The interviewer then asked me what changes I'd make to the solution now that I was finished. I mentioned the inefficiency of allocating new lists for allocations to get the lowest missing number for a given type. I should have filtered the list. Other than that, I couldn't see anything glaringly obvious that was wrong with my solution.

Conclusion

I completed both problems in just over 35 minutes, leaving some time for questions at the end. I ws a bit flustered due to the newness of the experience, and babbled something asking about the frontend that had been mentioned in my first interview. Got a decent response, then talked a bit about working at Assembled.

The whole process so far has been a good experience. I'm very glad I didn't just freeze up during the technical portion, and while I'm disappointed in my solution to the first problem, I got more relaxed as it went on and it was a bit easier. Both people who've interviewed me have been good, obviously very capable and focused, but have been friendly. Just have to see how things turn out and if I'm invited to an onsite, but I'm happy with my performance for my first run through the process.


Comment